package com.young.mhl.service;

import com.young.mhl.dao.MenuDAO;
import com.young.mhl.domain.Menu;

import java.util.List;

/**
 * @Author: young
 * @Date: 2021-12-04 17:00
 * @Description:
 */
public class MenuService {
	private MenuDAO menuDAO = new MenuDAO();
	
	//返回所有的菜品
	public List<Menu> list(){
		return menuDAO.queryMany("select * from menu", Menu.class);
	}
	
	// 根据id返回Menu对象
	public Menu getMenuById(int id){
		return menuDAO.querySingle("select * from menu where id = ?",Menu.class,id);
	}
}
